#ifndef MESSAGE_H
#define MESSAGE_H

#include <time.h>


//	TODO:	consider using protobuf
//			http://code.google.com/apis/protocolbuffers/docs/overview.html
//
//

typedef	enum	msg_type_e
{
	MSG_TYPE_CONNECT 	= 100,

	MSG_TYPE_CHAT_TEXT	= 200,
	MSG_TYPE_CHAT_IMG	= 201,
	MSG_TYPE_CAHT_VEDIO	= 202,
	
	MSG_TYPE_TAG_READ	= 250,				// user(receiver) read the msg already
	MSG_TYPE_TAG_TYPING	= 251,				// the user is typing

	MSG_TYPE_BAD_REQ	= 400,

	MSG_TYPE_DISCONNECT	= 500
} msg_type_t;

#pragma pack(push, 1)
// message head infomation
typedef struct	msg_head_s 
{
	msg_type_t		type;				// message type
	unsigned int	user_id_from;
	unsigned int	user_id_to;	

	unsigned int	yb_device_id_from;
	unsigned int	yb_device_id_to;
	
	time_t			times;
} msg_head_t;
#pragma pack(pop)

// MSG_TYPE_CONNECT
// connect message
typedef struct	msg_connect_s
{
	long long		IMEI;
	char *			email;				
} msg_connect_t;

// MSG_TYPE_TAG_READ
// the message receiver read already
typedef struct	msg_tag_read_s
{
} msg_tag_read_t;

// MSG_TYPE_TAG_READ
// the message receiver read already
typedef struct	msg_chat_text_s
{
	char *			chat_text;
} msg_chat_text_t;



#endif // MESSAGE_H///~
